package com.ht.medicaltreatment.viewmodel

import androidx.lifecycle.viewModelScope
import com.ht.medicaltreatment.bean.SearchUIDBean
import com.ht.medicaltreatment.bean.YangBenJieShouBean
import com.ht.medicaltreatment.bean.YangBenJieShouBeanRfidSample
import com.xgst.lib.http.ApiResult
import kotlinx.coroutines.launch

class SampleReceiveListViewModel:BaseViewModel() {
    fun queryName(uids:MutableList<String>, onSuccess:(YangBenJieShouBean)->Unit,
                  onError:(String)->Unit){
        viewModelScope.launch {
            when(val bean = mApi.sampleReceive(uids)){
                is ApiResult.Success -> {
                    onSuccess(bean.data.data!!)
                }
                is ApiResult.Error -> onError(bean.errorMessage)
            }
        }
    }
}